﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using GoDive.Contract;
namespace GoDive.Service
{
    public class GoDiveDBContext : DbContext
    {
        public GoDiveDBContext()
            : base("GoDiveDBContext")
        {
            base.Configuration.LazyLoadingEnabled = true;
            base.Configuration.ProxyCreationEnabled = true;
            //记录EF执行的SQL
#if DEBUG
                        this.Database.Log = s =>
                        {
                            System.IO.File.AppendAllText(System.Web.HttpContext.Current.Server.MapPath("/App_Data/SqlLog.txt"), s, Encoding.UTF8);
                        };
#endif
        }
        public DbSet<spider_data> spider_data { get; set; }
        public DbSet<tdestination> tdestination { get; set; }
        public DbSet<tdivesite> tdivesite { get; set; }
        public DbSet<tregion> tregion { get; set; }
        public DbSet<ttest> ttest { get; set; }
        public DbSet<tbanner> tbanner { get; set; }
        public DbSet<tdestinationalbum> tdestinationalbum { get; set; }
        public DbSet<tdesttraffic> tdesttraffic { get; set; }
        public DbSet<tarticle> tarticle { get; set; }
        public DbSet<tdescomment> tdescomment { get; set; }
        public DbSet<tuser> tuser { get; set; }



        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}